#include "app_mqtt.h"
#include "app_pool.h"
#include "app_device.h"
#include <stdio.h>
#include <unistd.h>
#include "app_bt.h"
#include "app_serial.h"

int main(int argc, char const *argv[])
{
   //1 初始化 
   int ret= app_mqtt_init();
   if(ret != 0)
   {
       printf("app_mqtt_init error\n");
       return -1;
   }
   ret=  app_pool_init();
   if(ret != 0)
   {
       printf("app_pool_init error\n");
       return -1;
   }
   app_device_t *device = app_device_init();
   if(device==NULL)
   {
       printf("app_device_init error\n");
       return -1;
   }
   //app_serial_init(device);

   app_bt_init(device);


   app_device_start();

   while(1)
   {
       sleep(1);
   }
    return 0;
}
